package com.ruoyi.consume.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.consume.mapper.SeedConsumeMapper;
import com.ruoyi.consume.domain.SeedConsume;
import com.ruoyi.consume.service.ISeedConsumeService;

/**
 * 查看领用信息Service业务层处理
 *
 * @author ruoyi
 * @date 2021-07-22
 */
@Service
public class SeedConsumeServiceImpl implements ISeedConsumeService
{
    @Autowired
    private SeedConsumeMapper seedConsumeMapper;

    /**
     * 查询查看领用信息
     *
     * @param seedConsumeId 查看领用信息ID
     * @return 查看领用信息
     */
    @Override
    public SeedConsume selectSeedConsumeById(Long seedConsumeId)
    {
        return seedConsumeMapper.selectSeedConsumeById(seedConsumeId);
    }

    /**
     * 查询查看领用信息列表
     *
     * @param seedConsume 查看领用信息
     * @return 查看领用信息
     */
    @Override
    public List<SeedConsume> selectSeedConsumeList(SeedConsume seedConsume)
    {
        return seedConsumeMapper.selectSeedConsumeList(seedConsume);
    }

    /**
     * 新增查看领用信息
     *
     * @param seedConsume 查看领用信息
     * @return 结果
     */
    @Override
    public int insertSeedConsume(SeedConsume seedConsume)
    {
        seedConsume.setCreateTime(DateUtils.getNowDate());
        return seedConsumeMapper.insertSeedConsume(seedConsume);
    }

    /**
     * 修改查看领用信息
     *
     * @param seedConsume 查看领用信息
     * @return 结果
     */
    @Override
    public int updateSeedConsume(SeedConsume seedConsume)
    {
        return seedConsumeMapper.updateSeedConsume(seedConsume);
    }

    /**
     * 批量删除查看领用信息
     *
     * @param seedConsumeIds 需要删除的查看领用信息ID
     * @return 结果
     */
    @Override
    public int deleteSeedConsumeByIds(Long[] seedConsumeIds)
    {
        return seedConsumeMapper.deleteSeedConsumeByIds(seedConsumeIds);
    }

    /**
     * 删除查看领用信息信息
     *
     * @param seedConsumeId 查看领用信息ID
     * @return 结果
     */
    @Override
    public int deleteSeedConsumeById(Long seedConsumeId)
    {
        return seedConsumeMapper.deleteSeedConsumeById(seedConsumeId);
    }

    /**
     * 获取用户下拉框
     *
     * @param
     * @return 结果
     */
    @Override
    public List<SeedConsume> getUserName(){
        return seedConsumeMapper.getUserName();
    }
}
